	var uid=document.getElementById("uid");
	var uname=document.getElementById("uname");
	var upass=document.getElementById("upass");

	uid.onblur=function(){
		var regx=/^\d{8}$/;
		var flag=regx.test(this.value);
		message(this,flag,'账户为八位数数字');
		return flag;
	}
	uid.oninput=function(){
		lenCheck(this,8,8);
	}
	uname.onblur=function(){
		var regx=/^[\u4e00-\u9fa5]{2,6}$/;
		var flag=regx.test(this.value);
		message(this,flag,'输入中文名');
		return flag;
	}
	upass.onblur=function(){
		var regx=/^(?![A-Za-z]+$)(?![A-Z0-9]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![A-Z\W_!@#$%^&*`~()-+=+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]{8,10}$/;
		var flag=regx.test(this.value);
		message(this,flag,'密码为10位以下包含数字、字母、特殊符号的混合');
		return flag;
	}
	upass.oninput=function(){
		lenCheck(this,8,10);
	}
function message(obj,flag,error){
	var span=obj.nextElementSibling;
	span.style.cssText="margin-top:5px;color: red;";
	var yes="border: 1px solid green";
	var no="border: 1px solid red";
	if(flag){
		obj.style.cssText=yes;
		span.innerHTML="";
	}else{
		obj.style.cssText=no;
		span.innerHTML=error;
		//console.log(span);
	}
}

function lenCheck(obj,min,max){
    var span=obj.nextElementSibling;
    span.innerHTML="";
    span.style.cssText="margin-top:5px;color: red;";
    var yes="border: 1px solid green";
    var no="border: 1px solid red";
    var len=obj.value.length;
    if(len>=min&& len<=max){
        obj.style.cssText=yes;
    }else{
        obj.style.cssText=no;
        span.innerHTML="长度不合法";
        //console.log(span);
    }
}

document.getElementById("utype").onchange=function(){
	//console.log(this.value);
	var span=this.nextElementSibling;
	span.style.cssText="margin-top:5px;color: blue;font-weight: bold;";
	span.innerHTML=this.value==2?"你选择的角色是学生":"你选择的角色是管理员";
}
document.getElementById('submit').onclick=function(){
	return uid.onblur()&&uname.onblur()&&upass.onblur();
}
document.getElementById('reset').onclick=function(){
	var span=document.getElementById('utype').nextElementSibling;
	span.innerHTML="";
}

